package com.ljty.gui;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.WindowConstants;

public class Start
	{
		boolean packFrame = false;

		public Start()
			{
				LoginView LV = new LoginView();

				if (packFrame)
					{
						LV.pack();
					} else
					{
						LV.validate();
					}
				Dimension screenSize = Toolkit.getDefaultToolkit()
						.getScreenSize();
				Dimension frameSize = LV.getSize();
				if (frameSize.height > screenSize.height)
					{
						frameSize.height = screenSize.height;
					}
				if (frameSize.width > screenSize.width)
					{
						frameSize.width = screenSize.width;
					}
				LV.setLocation((screenSize.width - frameSize.width) / 2,
						(screenSize.height - frameSize.height) / 2);
				LV.setBounds(300, 300, 310, 230);
				LV.setResizable(false);
				LV.setVisible(true);
			}

		public static void main(String[] args)
			{
				// TODO Auto-generated method stub
				SwingUtilities.invokeLater(new Runnable()
					{
						public void run()
							{
								try
									{
										UIManager.setLookAndFeel(UIManager
												.getSystemLookAndFeelClassName());
									} catch (Exception exception)
									{
										exception.printStackTrace();
									}

								new Start();
							}
					});
			}

	}
